{extend name="apps/common/view/admin.tpl" /} 
<!-- --> 
{block name="header_meta"}
<title>{:lang("daohang_admin_index")}－{:lang('appName')}</title>
{/block}
{block name="header_addon"}
<link href="{$path_root}{$path_addon}view/theme.css">
<script src="{$path_root}{$path_addon}view/theme.js"></script> 
{/block} 
<!-- --> 
{block name="main"}
<h6 class="border-bottom pb-2 text-purple">{:lang("daohang_admin_index")}</h6>
<div class="card-deck mb-2">
  <div class="card">
    <div class="card-body d-flex flex-row justify-content-between align-items-center">
      <div>
        <p class="card-title mb-1">{:lang('category')}</p>
        <h5 class="card-text" id="count-category">0</h5>
      </div>
      <i class="fa fa-2x fa-folder-o text-muted"></i> </div>
  </div>
  <div class="card">
    <div class="card-body d-flex flex-row justify-content-between align-items-center">
      <div>
        <p class="card-title mb-1">{:lang('tag')}</p>
        <h5 class="card-text" id="count-tag">0</h5>
      </div>
      <i class="fa fa-2x fa-tags text-purple"></i> </div>
  </div>
  <div class="card">
    <div class="card-body d-flex flex-row justify-content-between align-items-center">
      <div>
        <p class="card-title mb-1">{:lang('dh_option_web')}</p>
        <h5 class="card-text" id="count-web">0</h5>
      </div>
      <i class="fa fa-2x fa-desktop text-danger"></i> </div>
  </div>
  <div class="card">
    <div class="card-body d-flex flex-row justify-content-between align-items-center">
      <div>
        <p class="card-title mb-1">{:lang('dh_option_mp')}</p>
        <h5 class="card-text" id="count-mp">0</h5>
      </div>
      <i class="fa fa-2x fa-coffee text-primary"></i> </div>
  </div>
  <div class="card">
    <div class="card-body d-flex flex-row justify-content-between align-items-center">
      <div>
        <p class="card-title mb-1">{:lang('dh_option_mini')}</p>
        <h5 class="card-text" id="count-mini">0</h5>
      </div>
      <i class="fa fa-2x fa-qrcode text-success"></i> </div>
  </div>
</div>
<!---->
<div class="table-responsive-sm">
  <table class="table table-bordered bg-white mb-0">
    <tbody>
      <tr>
        <td class="w-25 align-middle"><strong>{:lang('dh_cache_index')}</strong></td>
        <td><a class="btn btn-purple btn-sm" href="{:DcUrl('admin/tool/clear_cache')}" data-toggle="get">{:lang('dh_cache_clear')}</a></td>
      </tr>
      <tr>
        <td class="w-25 align-middle"><strong>{:lang('dh_cache_tpl')}</strong></td>
        <td><a class="btn btn-purple btn-sm" href="{:DcUrl('admin/tool/clear_runtime')}" data-toggle="get">{:lang('dh_cache_clear')}</a></td>
      </tr>
      <tr>
        <td class="w-25 align-middle"><strong>{:lang('dh_admin_count')}</strong></td>
        <td><a class="btn btn-purple btn-sm" href="{:DcUrlAddon(['module'=>'daohang','controll'=>'task','action'=>'tagsCount'])}" data-toggle="get">{:lang('dh_update_count_tag')}</a></td>
      </tr>
      <tr>
        <td class="w-25 align-middle"><strong>{:lang('dh_admin_config')}</strong></td>
        <td><a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'config','action'=>'index'] )}" target="_blank">{:lang('daohang_config_index')}</a> <a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'auth','action'=>'index'] )}" target="_blank">{:lang('daohang_auth_index')}</a> <a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'seo','action'=>'index'] )}" target="_blank">{:lang('daohang_seo_index')}</a></td>
      </tr>
      <tr>
        <td class="w-25 align-middle"><strong>{:lang('dh_admin_content')}</strong></td>
        <td><a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'category','action'=>'index'] )}" target="_blank">{:lang('daohang_category_index')}</a> <a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'web','action'=>'index'] )}" target="_blank">{:lang('daohang_web_index')}</a> <a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'mp','action'=>'index'] )}" target="_blank">{:lang('daohang_mp_index')}</a> <a class="btn btn-purple btn-sm" href="{:DcUrlAddon( ['module'=>'daohang','controll'=>'mini','action'=>'index'] )}" target="_blank">{:lang('daohang_mini_index')}</a></td>
      </tr>
    </tbody>
  </table>
</div>
{/block}

{block name="js"} 
<script>
$(document).ready(function () {
    daicuo.ajax.get("{:DcUrlAddon( ['module'=>'daohang','controll'=>'count','action'=>'index'] )}", function(data, status, xhr){
        $('#count-category').text(data.category);
        $('#count-tag').text(data.tag);
        $('#count-web').text(data.web);
        $('#count-mp').text(data.mp);
        $('#count-mini').text(data.mini);
    });
});
</script> 
{/block}